﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
using System.Web;

namespace Lswweb.Controls
{
    public class ErrorMessage : SkinnedWebControl
    {
        private Label title;
        private Label body;

        public ErrorMessage(string title, string body)
        {
            this.Title = title;
            this.Body = body;
        }

        protected override void InitializeSkin(System.Web.UI.Control skin)
        {
            title = (Label)skin.FindControl("title");
            body = (Label)skin.FindControl("body");

            if(title!=null)
                title.Text = this.Title;
            
            if(body!=null)
                body.Text = this.Body;
        }

        public string Title { get; set; }

        public string Body { get; set; }

        protected override string DefaultSkinFilename
        {
            get { return "ErrorMessage.ascx"; }
        }
    }
}
